<ion-header>
  <ion-navbar>
    <ion-title>修改密码</ion-title>
  </ion-navbar>
</ion-header>
<ion-content>
  <ng-container *ngIf="isFirstStep">
    <form class="bgcolor_white" (ngSubmit)="forget()" [formGroup]="checkForm">
      <ion-list>
        <ion-item>
          <ion-input placeholder="手机号" type="text" formControlName="tel" [(ngModel)]="tel" clearInput
                     (input)="tel=$event.target.value"
                     max="{{max}}} min={{min}}">
          </ion-input>
        </ion-item>
        <ion-item>
          <ion-input placeholder="验证码" type="text" formControlName="verificationCode" [(ngModel)]="verificationCode"
                     (input)="verificationCode=$event.target.value" clearInput>
          </ion-input>
          <ion-label>
            <ion-buttons>
              <input type="button" ion-button style="font-size: 16px;color: #000000;font-weight: bold;"
                      (click)="getVerificationCode()" value="{{btnTitle}}">
            </ion-buttons>
          </ion-label>

        </ion-item>

      </ion-list>
      <div class="w12 plr15 mt15 mb15">
        <button ion-button color="primary" type="submit" [disabled]="!checkForm.valid" block>下一步</button>
      </div>
    </form>
  </ng-container>

  <ng-container *ngIf="!isFirstStep">
    <form class="bgcolor_white" (ngSubmit)="forget()" [formGroup]="forgetForm">
      <ion-list>
        <ion-item>
          <ion-label style="font-size: 16px;color: #000000;font-weight: bold;">新密码</ion-label>
          <ion-input placeholder="请输入密码,最少6位数" type="password" [(ngModel)]="newPassword" formControlName="newPassword"
                     (input)="newPassword=$event.target.value" clearInput></ion-input>
        </ion-item>
        <ion-item>
          <ion-label style="font-size: 16px;color: #000000;font-weight: bold;">确认密码</ion-label>
          <ion-input placeholder="请再次输入密码,密码需一致" type="password" [(ngModel)]="checkPassword"
                     formControlName="checkPassword" (input)="checkPassword=$event.target.value" clearInput></ion-input>
        </ion-item>
      </ion-list>
      <div padding>
        <button ion-button color="primary" type="submit" [disabled]="!forgetForm.valid" block>确认</button>
      </div>
    </form>
  </ng-container>

</ion-content>
